package com.hdd.biz.app.controller;

import com.hdd.biz.app.dto.*;
import com.hdd.biz.app.service.UserAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;

@RestController
@RequestMapping("/app/wallet")
@Api(value = "小程序-我的钱包",tags = {"小程序-我的钱包"})
public class UserAccountController {


    @Autowired
    private UserAccountService accountService;

    @PostMapping("/")
    @ApiOperation(value = "钱包" ,notes = "")
    public AppResponse wallet(@Valid @RequestBody AppRequest request ){
        return accountService.findAccount(request);
    }


    @PostMapping("/balanceDetails")
    @ApiOperation(value = "余额明细" ,notes = "")
    public AppResponse balanceDetails(@Valid @RequestBody BillRequest request ){
        return accountService.balanceDetails(request);
    }

    @PostMapping("/withdrawRecord")
    @ApiOperation(value = "提现记录" ,notes = "")
    public AppResponse withdrawRecord(@Valid @RequestBody WithdrawRequest request ){
        return accountService.withdrawRecord(request);
    }

    @PostMapping("/withdraw")
    @ApiOperation(value = "提现" ,notes = "")
    public AppResponse withdraw(@Valid @RequestBody WithdrawRequest request ){
        return accountService.withdraw(request);
    }

    @PostMapping("/rechargeRecord")
    @ApiOperation(value = "充值记录" ,notes = "")
    public AppResponse rechargeRecord(@Valid @RequestBody WithdrawRequest request ){
        return accountService.rechargeRecord(request);
    }

    @PostMapping("/withdrawConfigure")
    @ApiOperation(value = "提现配置" ,notes = "")
    public AppResponse withdrawConfigure(@Valid @RequestBody AppRequest request ){
        return accountService.withdrawConfigure(request);
    }

    @PostMapping("/alipayUpdate")
    @ApiOperation(value = "支付宝账号" ,notes = "")
    public AppResponse alipayUpdate(@Valid @RequestBody AliPayAccountRequest request ){
        return accountService.updateAlipay(request);
    }

    @PostMapping("/getCode")
    @ApiOperation(value = "支付宝修改验证码" ,notes = "")
    public AppResponse getCode(@Valid @RequestBody AliPayAccountRequest request ){
        return accountService.getCode(request);
    }

    @PostMapping("/getPaymentTips")
    @ApiOperation(value = "付款提示" ,notes = "")
    public AppResponse getPaymentTips(@Valid @RequestBody AppRequest request ){
        return accountService.getPaymentTips(request);
    }

    @PostMapping("/getPaymentTipsRest")
    @ApiOperation(value = "付款提示清空" ,notes = "")
    public AppResponse getPaymentTipsRest(@Valid @RequestBody AppRequest request ){
        return accountService.getPaymentTipsRest(request);
    }

    @PostMapping("/raymentTipsRest")
    @ApiOperation(value = "付款金额清空" ,notes = "")
    public AppResponse raymentTipsRest(@Valid @RequestBody AppRequest request ){
        return accountService.raymentTipsRest(request);
    }


}
